home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Aminet 35
/
Aminet 35 (2000)(Schatztruhe)[!][Feb 2000].iso
/
Guides
/
PicsData
/
Rexx
/
PZ_MakeIFF_HAM8.rexx
< prev
next >
Wrap
OS/2 REXX Batch file
|
1993-11-11
|
2KB
|
126 lines
/*
** $VER: $Id: PZ_MakeIFF_HAM8.rexx,v 5.0 1993/11/12 01:14:26 chris Exp $
** Copyright (C) 1992, 1993 by Christian A. Weber, Zürich, Switzerland.
** REXX script internally used by PicZoo. Do not start manually.
**
** You may wish to change MAXMEM for ADPro if you don't have enough RAM,
** and the delay after loading if you have a slow HD :)
*/
options results
arg adprodir filename destname maxwidth maxheight
address 'ADPro'
/*
** Set the desired screen dimensions. If we don't set them manually, we get
** the current text overscan values, which is just what we want!
*/
/* maxwidth = 704 */
/* maxheight = 468 */
/*
** Make sure ADPro is running
*/
IF ~show(ports,'ADPro') THEN
DO
Address COMMAND 'C:Assign ADPRO: '||adprodir
Address COMMAND 'Run >NIL: ADPRO:ADPro MAXMEM=5000000 BEHIND'
Address COMMAND 'C:Wait 5'
IF ~show(ports,'ADPro') THEN EXIT
END
/*
** Screen types for ADPro
*/
LORES = 0
HIRES = 1
LACE = 2
PAL = 4
XOVERSCAN = 8
YOVERSCAN = 16
/*
** Now load the picture ...
*/
PSTATUS UNLOCKED
SCREEN_TYPE LORES
LFORMAT 'UNIVERSAL'
LOAD filename
IF RC == 0 THEN DO
/*
** Get the picture size
*/
XSIZE
origwidth = (ADPRO_RESULT*11) / 10 /* Correct aspect ratio for Amiga */
YSIZE
origheight = ADPRO_RESULT
/*
** Now determine the new width and height, so the picture fits
** into maxwidth/maxheight
*/
width = maxwidth
height = (origheight * maxwidth) / origwidth
IF height > maxheight THEN DO
width = (origwidth * maxheight) / origheight
height = maxheight
END
/*
** Now set the parameters for the screenmode depending on the picture's
** type (GRAY or COLOR)
*/
IMAGE_TYPE
IF WORD(ADPRO_RESULT,1) = "GRAY" THEN DO
POFFSET 0
PTOTAL 16
PUSED 16
PTOTAL 16
RENDER_TYPE 16
SCREEN_TYPE HIRES + LACE + XOVERSCAN + YOVERSCAN
END
ELSE DO
POFFSET 0
PUSED 64
PTOTAL HAM8
PUSED 64
RENDER_TYPE HAM8
SCREEN_TYPE HIRES + LACE + XOVERSCAN + YOVERSCAN
END
/*
** Make sure we get the best dynamic range
*/
OPERATOR DYNAMIC_RANGE 0 255
/*
** Scale the image and render it
*/
ABS_SCALE width height
DITHER 1 /* Floyd-Steinberg */
EXECUTE
/*
** Now save the result as IFF in the user's IFF directory
*/
SFORMAT IFF
SAVE destname IMAGE
END
ELSE DO
say filename || ': not a picture'
END